---
- when: {message_type: KojiBuildPackageCompleted}
  do:
    - {tasks: [rpmlint, rpmgrill, python-versions]}
    - {discover: {repo: '{{ trigger_distgit_repo_url }}/rpms/${name}{{'.git' if deployment_type in ['stg'] else ''}}', branch: "${distgit_branch}", fallback_branch: 'master', recursive: true}}

- when: {message_type: KojiBuildPackageCompleted, name: docker}
  do:
    - {tasks: [dockerautotest]}

- when:
    message_type: KojiBuildPackageCompleted
    name:
{% if deployment_type in ['stg', 'prod'] %}
      $in: ${critpath_pkgs}
{% endif %}
      $nin: [firefox,thunderbird,kernel,kdelibs,kdepim,qt,mariadb,java-1.8.0-openjdk,libreoffice]
  do:
    - {tasks: [abicheck]}

- when: {message_type: KojiTagChanged}
  do:
    - {tasks: [rpmdeplint]}

{% if deployment_type not in ['stg'] %}
{# stg bodhi doesn't have the info we need, stg koji doesn't have the builds from prod bodhi #}
- when:
    message_type: KojiTagChanged
    tag: {$regex: '/.*(?<!testing-pending)$$/'}
  do:
    - {tasks: [upgradepath]}
{% endif %}

- when: {message_type: DistGitCommit, namespace: modules}
  do:
    - {tasks: [check_modulemd]}

- when:
    message_type: AtomicCompose
  do:
    - {tasks: [upstream-atomic, fedora-cloud-tests]}

- when:
    message_type: CloudCompose
  do:
    - {tasks: [fedora-cloud-tests]}

- when:
    message_type: ModuleBuildComplete
  do:
    - {tasks: [modularity-testing-framework]}
